package com.spddr.pmos.jpa;

import javax.persistence.Embeddable;

@Embeddable
public class TradeResultId implements java.io.Serializable {
	private static final long serialVersionUID = 1L;

	private long trade;
	private long buyer;
	private long saler;

	public TradeResultId() {
	}

	public TradeResultId(long trade, long buyer, long saler) {
		super();
		this.trade = trade;
		this.buyer = buyer;
		this.saler = saler;
	}

	public long getTrade() {
		return trade;
	}

	public void setTrade(long trade) {
		this.trade = trade;
	}

	public long getBuyer() {
		return buyer;
	}

	public void setBuyer(long buyer) {
		this.buyer = buyer;
	}

	public long getSaler() {
		return saler;
	}

	public void setSaler(long saler) {
		this.saler = saler;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (buyer ^ (buyer >>> 32));
		result = prime * result + (int) (saler ^ (saler >>> 32));
		result = prime * result + (int) (trade ^ (trade >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TradeResultId other = (TradeResultId) obj;
		if (buyer != other.buyer)
			return false;
		if (saler != other.saler)
			return false;
		if (trade != other.trade)
			return false;
		return true;
	}
}